<?php
class ModelUserUserDefine extends Model {

    public function editUserDefine($user_define_id, $data) {
        $this->db->query("UPDATE " . DB_PREFIX . "user_define SET name = '" . $this->db->escape($data['name']) . "',  description = '" . $this->db->escape($data['description']) . "', date_modify = now()  WHERE user_define_id = '" . (int)$user_define_id . "'");
    }



    public function getUserDefine($user_define_id) {
        $query = $this->db->query("SELECT DISTINCT * FROM " . DB_PREFIX . "user_define WHERE user_define_id = '" . (int)$user_define_id . "'");

        return $query->row;
    }

    public function getUserDefines($data = array()) {
        $sql = "SELECT * FROM " . DB_PREFIX . "user_define";

        $query = $this->db->query($sql);

        return $query->rows;
    }


}